﻿namespace Arms.Domain.Modules.Geography
{
    using System;

    public static class PointRepositoryExtensions
    {
        /// <summary>
        /// Find a point by its lat/long
        /// </summary>
        /// <param name="repo"></param>
        /// <param name="latitude"></param>
        /// <param name="longitude"></param>
        /// <returns></returns>
        public static Point FindByLatLong(this IRepository<Point> repo, double latitude, double longitude)
        {
            return repo.Single(x => x.Data.Latitude == latitude && x.Data.Longitude == longitude);
        }
    }
}
